package com.zhihuishu.micro.course.service.impl;

import com.zhihuishu.micro.course.dto.ChapterDto;
import com.zhihuishu.micro.course.service.ChapterTreenityRedisService;
import com.zhihuishu.toolkit.jedis.JedisHelper;
import org.springframework.stereotype.Service;

@Service("chapterAllServiceRedis")
public class ChapterAllServiceRedisImpl extends BaseTreenityBatchServiceRedisImpl<ChapterDto> implements ChapterTreenityRedisService {
    @Override
    protected Class<ChapterDto> getDTOClass() {
        return ChapterDto.class;
    }

    @Override
    public String getObjectKey(Integer chapterId) {
        return JedisHelper.key("cc:chapter", chapterId);
    }

    @Override
    public String getIdsKey(long courseId) {
        return JedisHelper.key("cc:course", courseId, "chapters:all");
    }
}
